package ltd.hxya.novel.common.bean;

/**
 * 00：通用模块
 *   200:执行成功
 *   000:未知异常
 *
 * 01：feign调用异常
 *   001:feign调用book异常
 */
public enum ResultEnum {
    /**
     * 执行成功
     */
    EXECUTE_SUCCESS(200,"执行成功"),
    UN_KNOWN_EXCEPTION(00000,"未知异常，请联系管理员处理"),
    FEIGN_ERROR(01001,"book模块feign调用异常"),

    /**
     * 爬虫模块
     */
    CRAWL_RULE_NULL(101,"爬虫规则不能为空"),
    CRAWL_RULE_ERROR(102,"爬虫规则错误"),
    CRAWL_SOURCE_EXIST(102,"该爬虫源已存在"),
    NOT_AVAILABLE_IP(103,"暂无可用ip"),

    /**
     * 用户模块
     */
    USER_NAME_IS_REGISTER(301,"账号已注册"),
    NOT_REGISTER(302,"该用户未注册，请先注册"),
    PASSWORD_ERROR(303,"密码错误,请重新输入"),
    NOT_LOGIN(304,"用户未登录，请先登录"),
    VERIFY_CODE_EXPIR(305,"验证码过期，请刷新重试"),
    VERIFY_CODE_ERROR(306,"验证码错误"),
    USER_LOGIN_EXPIR(307,"用户登录已过期"),
    USER_IS_EXIST(308,"用户已存在"),
    USER_IS_DELETE(309,"该用户已删除"),

    /**
     * 通用
     */
    USER_TOKEN_EXPIRE(350,"登录已过期，请重新登录"),
    NOT_DATA(351,"数据为空"),
    NETWORK_EXCEPTION(352,"网络异常，请稍后重试"),
    MYSQL_OPERATION_ERROR(353,"数据库操作出现错误"),

    /**
     * 缓存
     */
    CACHE_DELETE(363,"该缓存已删除"),

    /**
     * 参数校验
     */
    PARAM_VALID_FAIL(401,"参数校验失败,失败原因："),

    /**
     * 后台管理系统，从410-450
     */
    ADMIN_LOGIN_ERROR(410,"请确认账号或密码正确"),
    ADMIN_LACK_PREMISSION(401,"用户权限不足，请联系管理员修改权限"),


    /**
     * 小说部分
     */
    NOVEL_NOT_FREE(451,"该章节小说仅支持收费阅读"),

    /**
     * 异常提醒
     */
    OPERATION_EXCEPTION(500,"操作异常，请规范操作");
    private Integer code;
    private String msg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
    ResultEnum(Integer code,String msg){
        this.code = code;
        this.msg = msg;
    }
}
